import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'
import Welcome from '../views/WelcomeView.vue'
import Login from '../views/LoginView.vue'

// 定义路由规则
  const routes = [
    {
      path: '/',
      name: 'home',
      component: HomeView,
      redirect: '/welcome',
      meta: {
        title: '首页'
      },
      children: [
        {
          name: 'welcome',
          path: '/welcome',
          component:Welcome,
          meta:{
            title: '欢迎页'
          }
        },{
          name: 'login',
          path: '/login',
          component:Login,
          meta:{
            title: '登录页'
          }
        }
      ]
    },
  ]





const router = createRouter({
  routes,
  history: createWebHistory(import.meta.env.BASE_URL),
})

export default router
